<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <title>公司管理后台</title>
    <link rel="stylesheet" href="{{URL::asset('bg-ui/css/vendor/bootstrap/dist/bootstrap.css')}}">
    <link rel="stylesheet" href="{{URL::asset('bg-ui/css/vendor/Animate.css')}}">
    <link rel="stylesheet" href="{{URL::asset('bg-ui/css/basic.css')}}">
    <link rel="stylesheet" href="{{URL::asset('bg-ui/css/vendor/font_awesome/css/font-awesome.css')}}">
    <script src="{{URL::asset('js/jquery-2.0.0.min.js')}}"></script>
    <script src="{{URL::asset('vendor/layer/layer.js')}}"></script>
    <!--[if lt IE 9]>
    <script src="{{URL::asset('bg-ui/js/vendor/html5shiv.min.js')}}"></script>
    <script src="{{URL::asset('bg-ui/js/vendor/respond.min.js')}}"></script>
    <![endif]-->
</head>

<body>

<div class="container">
    <form class="form-signin" method="get" action="" onsubmit="javascript:return false;">
        {{ csrf_field() }}
        <div class="logo animated bounceIn" style="height:180px;">
            {{--<img  style="display:none;" src="{{URL::asset('images/logo.png')}}"/>--}}
        </div>
        <h3 style="font-size: 22px;color: #333">欢迎使用公司管理后台</h3>
        <div class="form-group">
            <!--[if lt IE 9]><label>用户名</label><![endif]-->
            <input type="text" name="username" class="form-control" placeholder="用户名" required="required" autofocus="autofocus">
        </div>
        <div class="form-group">
            <!--[if lt IE 9]><label>密码</label><![endif]-->
            <input type="password" name="password" class="form-control" placeholder="密码" required="required">
        </div>
        <input type="button" class="btn btn-lg btn-primary btn-block subBtn" id="signInBtn" value="登录" onclick="signIn()" />
        <!-- <div class="copyright"><i class="fa fa-copyright"></i><a href="https://github.com/liyu365">liyu</a></div> -->
    </form>
</div>
<script src="{{URL::asset('bg-ui/js/vendor/bootstrap/dist/bootstrap.js')}}"></script>
<script src="{{URL::asset('bg-ui/js/vendor/ie10-viewport-bug-workaround.js')}}"></script>
<script>
    document.onkeydown = keyDownSearch;
    function keyDownSearch(e) {
        // 兼容FF和IE和Opera
        var theEvent = e || window.event;
        var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
        if (code === 13) {
            $('#signInBtn').click();
            return false;
        }
        return true;
    }

    function signIn() {
        $.post('', {
            username: $('input[name="username"]').val(),
            password: $('input[name="password"]').val()
        }, function(res) {
            if (res.status === 1) {
                location.href = '{{url('agent/agent/index')}}';
            } else {
                layer.msg(res.info, {icon: res.status});
            }
        }, 'json');
    }
</script>
</body>
</html>